import { defHttp } from '@/utils/http/axios'

// 查询订单记录列表
export function getOrderPage(params) {
  return defHttp.get({ url: '/biz/order/page', params })
}

// 查询订单记录详情
export function getOrder(id: number) {
  return defHttp.get({ url: `/biz/order/get?id=${id}` })
}

// 新增订单记录
export function createOrder(data) {
  return defHttp.post({ url: '/biz/order/create', data })
}

// 修改订单记录
export function updateOrder(data) {
  return defHttp.put({ url: '/biz/order/update', data })
}

// 删除订单记录
export function deleteOrder(id: number) {
  return defHttp.delete({ url: `/biz/order/delete?id=${id}` })
}

// 导出订单记录 Excel
export function exportOrder(params) {
  return defHttp.download({ url: '/biz/order/export-excel', params }, '订单记录.xlsx')
}

export function exportOrder2(params) {
  return defHttp.download({ url: '/biz/order/export-excel2', params }, '账单.xlsx')
}

export function callback(id: number) {
  return defHttp.get({ url: `/biz/order/callback?id=${id}` })
}
